// pages/classify/classify.js
Page({

  switchRightTab: function (e) {
    let id = e.target.dataset.id,
      index = parseInt(e.target.dataset.index);
    this.setData({
      curNav: id,
      curIndex: index
    })
  },

  /**
   * 页面的初始数据
   */
  data: {
    cateItems: [
      {
        cate_id: 1,
        cate_name: "果园优选",
        ishaveChild: true,
        children:
        [
          {
            child_id: 1,
            name: '奇异果',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161208/148117972563.jpg"
          },
          {
            child_id: 2,
            name: '苹果',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161207/148110444480.jpg"
          },
          {
            child_id: 3,
            name: '橙柑橘柚',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161208/148117973270.jpg"
          },
          {
            child_id: 4,
            name: '蓝莓/草莓',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161208/148117981591.jpg"
          },
          {
            child_id: 5,
            name: '牛油果',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161208/148117981591.jpg"
          },
          {
            child_id: 6,
            name: '冷冻虾类',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161208/148117981591.jpg"
          },
          {
            child_id: 7,
            name: '牛排',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161208/148117981591.jpg"
          },
          {
            child_id: 8,
            name: '牛肉类',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161208/148117981591.jpg"
          }
        ]
      },
      {
        cate_id: 2,
        cate_name: "端午礼品",
        ishaveChild: true,
        children:
        [
          {
            child_id: 1,
            name: '生鲜礼盒',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161212/14815381301.jpg"
          },
          {
            child_id: 2,
            name: '端午礼盒',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161212/14815381411.jpg"
          }
        ]
      },

      {
        cate_id: 3,
        cate_name: "新鲜水果",
        ishaveChild: true,
        children:
        [
          {
            child_id: 1,
            name: '奇异果',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/14815978910.jpg"
          },
          {
            child_id: 2,
            name: '苹果',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/148159789883.jpg"
          },
          {
            child_id: 3,
            name: '橙柑橘柚',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/14815979307.jpg"
          },
          {
            child_id: 4,
            name: '蓝莓/草莓',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/148159765589.jpg"
          },
          {
            child_id: 5,
            name: '牛油果',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/14815979307.jpg"
          },
          {
            child_id: 6,
            name: '葡萄/提子',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/148159765589.jpg"
          },
          {
            child_id: 7,
            name: '热带水果',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/14815978910.jpg"
          },
          {
            child_id: 8,
            name: '瓜类',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/148159789883.jpg"
          },
          {
            child_id: 9,
            name: '特色鲜果',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/14815979307.jpg"
          }
        ]
      },
      {
        cate_id: 4,
        cate_name: "水产海鲜",
        ishaveChild: true,
        children:
        [
          {
            child_id: 1,
            name: '冷冻鲜虾',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161208/148117972563.jpg"
          },
          {
            child_id: 2,
            name: '冷冻鱼类',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161207/148110444480.jpg"
          },
          {
            child_id: 3,
            name: '冷冻贝类',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161208/148117973270.jpg"
          },
          {
            child_id: 4,
            name: '鲜活蟹类',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161208/148117981591.jpg"
          }
        ]
      },
      {
        cate_id: 5,
        cate_name: "肉禽蛋类",
        ishaveChild: true,
        children:
        [
          {
            child_id: 1,
            name: '猪肉类',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161212/14815381301.jpg"
          },
          {
            child_id: 2,
            name: '羊肉类',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161212/14815381411.jpg"
          },
          {
            child_id: 3,
            name: '牛肉类',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161212/14815381301.jpg"
          },
          {
            child_id: 4,
            name: '牛排',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161212/14815381411.jpg"
          },
          {
            child_id: 5,
            name: '鸡鸭禽肉',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161212/14815381301.jpg"
          },
          {
            child_id: 6,
            name: '蛋类',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161212/14815381411.jpg"
          }
        ]
      },

      {
        cate_id: 6,
        cate_name: "乳品速食",
        ishaveChild: true,
        children:
        [
          {
            child_id: 1,
            name: '面点/面食',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/14815978910.jpg"
          },
          {
            child_id: 2,
            name: '熟食料理',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/148159789883.jpg"
          }
        ]
      },
      {
        cate_id: 7,
        cate_name: "粮油干货",
        ishaveChild: true,
        children:
        [
          {
            child_id: 1,
            name: '米面',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161208/148117972563.jpg"
          },
          {
            child_id: 2,
            name: '粮用油',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161207/148110444480.jpg"
          },
          {
            child_id: 3,
            name: '南北干货',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161208/148117973270.jpg"
          },
          {
            child_id: 4,
            name: '五谷杂粮',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161208/148117981591.jpg"
          }
        ]
      },
      {
        cate_id: 8,
        cate_name: "休闲食品",
        ishaveChild: true,
        children:
        [
          {
            child_id: 1,
            name: '零食',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161212/14815381301.jpg"
          }
        ]
      },

      {
        cate_id: 9,
        cate_name: "冲调保健",
        ishaveChild: true,
        children:
        [
          {
            child_id: 1,
            name: '保健',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/14815978910.jpg"
          },
          {
            child_id: 2,
            name: '冲调',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/148159789883.jpg"
          }
        ]
      },
      {
        cate_id: 10,
        cate_name: "礼盒劵卡",
        ishaveChild: true,
        children:
        [
          {
            child_id: 1,
            name: '水果礼盒',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/14815978910.jpg"
          },
          {
            child_id: 2,
            name: '生鲜礼盒',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/148159789883.jpg"
          },
          {
            child_id: 1,
            name: '组合套餐',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/14815978910.jpg"
          },
          {
            child_id: 2,
            name: '充值劵卡',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/148159789883.jpg"
          }
        ]
      },
      {
        cate_id: 11,
        cate_name: "果园周边",
        ishaveChild: true,
        children:
        [
          {
            child_id: 1,
            name: '果园周边',
            image: "http://mz.djmall.xmisp.cn/files/logo/20161213/14815978910.jpg"
          }
        ]
      }
    ],
    curNav: 1,
    curIndex: 0
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})